package com.sefon.smarteconomy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.sefon.smarteconomy.dao.IClientBusDao;
import com.sefon.smarteconomy.domain.ClientBus;
import com.sefon.smarteconomy.service.IClientBusService;

/**
 * 
* Copyright: Copyright (c) 2018 SefonSoft
* 
* @ClassName: ClientBusServiceImpl.java
* @Description: 客户业务信息service接口实现类
*
* @version: v1.0.0
* @author: SF2170
* @date: 2018/03/26 22:07:28
* @by AnalysisExcel2File.java
*
 */
@Service
public class ClientBusServiceImpl implements IClientBusService {

	@Autowired
	private IClientBusDao clientBusDao;
	
	/**
	 * 
	*
	* @return
	* @see com.sefon.smarteconomy.service.IClientBusService#queryList()
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* 2018年03月26日     SF2170           v1.0.0             修改原因
	 */
 	@Cacheable
	@Override
	public List<ClientBus> queryList() {
		return clientBusDao.findAll();
	}

	/**
	 * 
	*
	* @param clientBus
	* @see com.sefon.smarteconomy.service.IClientBusService#save(com.sefon.smarteconomy.domain.ClientBus)
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* 2018年03月26日      SF2170           v1.0.0               修改原因
	 */
	@Override
	public void save(ClientBus clientBus) {
		clientBusDao.save(clientBus);
	}

	/**
	 * 
	*
	* @param userId
	* @see com.sefon.smarteconomy.service.IClientBusService#deleteByUserId(java.lang.Long)
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* 2018年03月26日     SF2170           v1.0.0               修改原因
	 */
	@Override
	public void deleteByUserId(Long userId) {
		clientBusDao.deleteById(userId);
		
	}

	/**
	 * 
	*
	* @param userId
	* @return
	* @see com.sefon.smarteconomy.service.IClientBusService#findByUserId(java.lang.Long)
	*
	* Modification History:
	* Date         Author          Version            Description
	*---------------------------------------------------------*
	* 2018年03月26日      SF2170           v1.0.0               修改原因
	 */
	@Override
	public ClientBus findByUserId(Long userId) {
		return clientBusDao.findOneById(userId);
	}

}
